<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <!-- <link rel="icon" type="image/svg+xml" href="/" /> -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <link rel="icon" type="image/svg+xml" href="/logo.svg" />
  <meta name="renderer" content="webkit">
  <meta http-equiv="expires" content="0">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="pragma" content="no-cache">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="debug" content="true">
  <title>DEXX</title>
  <style>
   
    .light-bg .loading-index {
      /* background-color: rgba(33, 37, 48,0.4); */
    }
    .loading-index {
      /* background: rgba(255, 255, 255, 0.4); */
      height: 100%;
      left: 0;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      z-index: 1999;
    }

    .loading-index .tv-spinner {
      animation: tv-spinner__container-rotate-aLqboHuu 0.9s linear infinite;
      border-bottom: 4px solid #8797a533;
      border-left: 4px solid #8797a533;
      border-radius: 50%;
      border-right: 4px solid #8797a533;
      border-top: 4px solid #8797a533;
      border-left-color: rgba(255, 211, 32, 0.4);
      border-top-color: rgba(255, 211, 32, 0.4);
      height: 50px;
      left: calc(50% - 25px);
      margin: 0 auto;
      position: absolute;
      top: calc(50% - 25px);
      width: 50px;
    }

    @keyframes tv-spinner__container-rotate-aLqboHuu {
      to {
        transform: rotate(1turn);
      }
    }
  </style>
</head>

<body>
  <div id="app">
    <div class="loading-index">
      <div class="tv-spinner"></div>
    </div>
  </div>
  <script type="module" src="/src/main.js"></script>
  <script>
    function refreshTvIos() {
      window.refreshTv();
      return 'refreshTvIos调用'
    }

    function windUpdateWidget(symbolInfo) {
      if (window.updateWidget) {
        window.updateWidget(symbolInfo);
        return "调用了windUpdateWidget-2"
      } else {
        setTimeout(() => {
          windUpdateWidget(symbolInfo)
        }, 0);
        return "调用了windUpdateWidget-1"
      }
      // return "调用了windUpdateWidget"
    }

    function getQueryString(name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) return decodeURI(r[2]);
      return null;
    }

    // 设置默认主题
    let body = document.body;
    let theme = getQueryString('pattern')
    body.style.background = theme == 2 ? "rgba(33, 37, 48,1)" : 'rgba(255, 255, 255,1)'
    window.onload = function () {
      let app = document.getElementById('app')
      app.style.background = theme == 2 ? "rgba(33, 37, 48,1)" : 'rgba(255, 255, 255, 1)'
      // body.style.display = 'block'
      //  windUpdateWidget({
      //   pair_ca: "0x0005e66b62000875561AC4E7c838E15Aea4C1629",
      //   chain_id: "1",
      // })
    }
  </script>
</body>

</html>